package com.wl.jetpackdemo.base.db.user

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query

/**
 *
 * Created by wangliang on 2021/1/29.
 */
@Dao
interface UserDao {
    @Query("SELECT * FROM user")
    suspend fun getAll(): List<User>

    @Query("select * from user where id = :id")
    suspend fun getById(id: Int): User

    @Insert
    suspend fun insert(user: User)

    @Delete
    suspend fun delete(user: User)
}